<template>
	<view class="Doorrecordbody">
		<!-- <u-table font-size="22rpx" style="height: 100%; overflow-y: auto;">
				<u-tr>
					<u-th>开门时间</u-th>
					<u-th>事件</u-th>
					<u-th>人名</u-th>
				</u-tr>
				<u-tr  v-for="(item,key) in list" :key='key'>
					<u-td>{{item.dt}}</u-td>
					<u-td>{{DoorEvent[item.rt]['val']}}</u-td>
					<u-td>{{item.pn}}</u-td>
				</u-tr>
			</u-table> -->
			<view  style="background-color: #dcdcdc;text-align: center;height: 60rpx;line-height: 60rpx;font-size: 25rpx;">
				{{LctnName}}_{{DoorName}}
			</view>
			<view class="box_cell">
				<u-cell-item v-for="(item,index) in list" :key='index' :border-bottom='true' :value-style="{width:'80rpx,height:60rpx'}"
				 :arrow='false' :title="item.dt" :label="DoorEvent[item.rt]['val']" @click = 'DoorItemClick(item)'>
					<view slot="right-icon">
						<text>{{item.pn}}</text>
						<!-- {{index}} -->
						<!-- <u-icon size="50" :name="item.Activity?'star-fill':'star'" @click.stop="starClick(item,index)"></u-icon> -->
					</view>
				</u-cell-item>
			</view>
	</view>
</template>

<script>
	import http from '../../common/vmeitime-http/index.js';
	import DoorEvent from '../../utils/DoorEvent_cn.js'
	export default {
		data() {
			return {
				DoorEvent:DoorEvent,
				LctnName:'',
				DoorName:"",
				list:[]
			}
		},
		onLoad(option) {
			console.log(2)
			console.log(option)
			this.LctnName = option.LctnName;
			this.DoorName = option.DoorName;
			http.GetDoorRecord({
				DoorID: option.id,
				CustomerID: option.cid
			}).then(res=>{
				this.list=res.data.records
			}).catch(err=>{
				uni.showModal({
					title: '联网失败',
					duration: 2000,
					icon:"none"
				})
			})
			
			
		},
		created() {
			console.log(1)
		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scoped>
	.Doorrecordbody{
		width: 100%;
		height: 100%;
		overflow: hidden;
		.box_cell{
			height: calc(100% - 60rpx);
			overflow-y: auto;
		}
	}
</style>
